import store from '../store/index.js'
import {
  SET_BLUETOOTH_INFO
} from '../store/modules/mutation_types.js'

// 监听蓝牙设备连接状态
// uni.onBLEConnectionStateChange(function(res) {
//   // 该方法回调中可以用于处理连接意外断开等异常情况
//   console.log(`device ${res.deviceId} state has changed, connected: ${res.connected}`, res)
//   // 
//   if (!res.connected) {
//     store.commit(SET_BLUETOOTH_INFO, {
//       deviceId: res.deviceId,
//       connected: false
//     })
//   } else {

//   }
// })
